﻿using CatUtils.Utils.Currency.IoUtils;
using CatUtils.Utils.SpecialUtils.View;
using SinaImgUpload.SainTool.LocalTool;
using System;
using System.Windows.Forms;

namespace SinaImgUpload.UserView
{
    public partial class OrdinaeyControl : UserControl
    {
        public OrdinaeyControl()
        {
            InitializeComponent();
        }

        private void button11_Click(object sender, EventArgs e)
        {
            string NewFileName = new UploadListFile().UpListFile(FileHelper.SelectFile());

            if (MessageHelper.DialogResultAlert("是否清理失效链接？"))
                ClearFile.AutoSaveList(NewFileName);
        }

        private void button12_Click(object sender, EventArgs e)
        {
            string FLoderPath = FloderHelper.SelectFloder();
            new UploadListFile().UpListFloder(FLoderPath);

            if (MessageHelper.DialogResultAlert("是否清理失效链接？"))
                ClearFile.AutoSaveListBatch(FLoderPath);
        }

        private void button7_Click(object sender, EventArgs e)
        {
            ClearFile.AutoSaveList(FileHelper.SelectFile());
        }

        private void button9_Click(object sender, EventArgs e)
        {
            ClearFile.AutoSaveListBatch(FloderHelper.SelectFloder());
        }

        private void button8_Click(object sender, EventArgs e)
        {
            string FloderPath = FloderHelper.SelectFloder();
            new FolderToList().UploadChildFloder(FloderPath);

            if (MessageHelper.DialogResultAlert("是否清理失效链接？"))
                ClearFile.AutoSaveListBatch(FloderPath);
        }

        private void button6_Click(object sender, EventArgs e)
        {
            String FlodeName = FloderHelper.SelectFloder();
            new FolderToList().UploadSingleFloder(FlodeName);

            if (MessageHelper.DialogResultAlert("是否清理失效链接？"))
                ClearFile.AutoSaveListBatch(FlodeName);
        }

        private void button13_Click(object sender, EventArgs e)
        {
            new UploadHtml().UploadSingle(FileHelper.SelectFile());
        }

        private void button14_Click(object sender, EventArgs e)
        {
            new UploadHtml().UploadFloder(FloderHelper.SelectFloder());
        }

        private void button3_Click(object sender, EventArgs e)
        {
            new ClearFile().ClearXmlWithFile(FileHelper.SelectFile());
        }

        private void button15_Click(object sender, EventArgs e)
        {
            new ClearFile().ClearXmlWithFlode(FloderHelper.SelectFloder());
        }
    }
}